<template>
	<view class="money-txt" :class="type">
		<text class="icon">￥</text>
		<text class="value">{{moneyText}}</text>
	</view>
</template>
<script>
	export default {
		props: {
			value: {
				type: Number
			},
			cent: {
				type: Boolean,
				default: false
			},
			type: {
				type: String,
				default: 'primary'
			}
		},
		data() {
			return {}
		},
		computed: {
			moneyText() {
				return this.cent ? this.value / 100 : this.value
			}
		}
	}
</script>
<style lang="scss" scoped>
	.money-txt {
		display: flex;
		align-items: baseline;

		.value {
			font-weight: 700;
			font-size: 1.2rem;
		}
	}

	.primary {
		.icon {
			color: #fa4126;
		}

		.value {
			color: #fa4126;
		}
	}

	.info {
		.icon {
			color: #999;
		}

		.value {
			color: #999;
		}
	}
</style>